package com.ity.teamanagement.entity.inputParam;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author coderFu
 * @create 2021/11/10
 */
@ApiModel("文章发布参数")
@Data
public class AddArticleParam {

    @ApiModelProperty("文章标题")
    @NotBlank(message = "文章标题不能为空")
    private String title;

    @ApiModelProperty("文章内容")
    @NotBlank(message = "文章内容不能为空")
    private String content;

    @ApiModelProperty("发布人名称")
    @NotBlank(message = "文章发布人不能为空")
    private String userName;

    @ApiModelProperty("文章类型 1、新闻 2、学术研究")
    @NotNull(message = "文章类型不能为空")
    @Range(min = 1,max =  2,message = "文章类型可选为 1 或 2")
    private Integer type;
}
